Conventionally, a technology that removes mosquito noise from a digitally compressed image using an (epsilon) filter is known. The mosquito noise is noise that tends to occur at sharp contour portions during compression of image data with a compression format such as JPEG, MPEG, or the like. An filter is a nonlinear filter for removing mosquito noise while preserving steep changes in pixel value at the sharp contour portions and the like. JP 2005-167520A discloses two methods for removing mosquito noise, which are called “new algorithm” and “conventional algorithm”.
According to the new algorithm disclosed in JP 2005-167520A, a digitally compressed image is divided into blocks having a size of N×N without overlapping. Subsequently, for each block, a standard deviation of luminance values of a plurality of pixels within that block is calculated, and the calculated standard deviation is set as an value of the filter for the pixels within that block. When the values have been derived, for each pixel of the digitally compressed image, an average value of one or more pixel values that are, among pixel values of a plurality of pixels within a block centered on that pixel and having a size of M×M, within a range of the pixel value of that pixel±ε is calculated and used as a corrected value of the pixel value of that pixel. The average value is calculated for each color component. The corrected value of the pixel value is a pixel value after the mosquito noise has been removed. It should be noted that in JP 2005-167520A, specific numerical values of N=8 and M=5, 7, and 9 are given for the new algorithm.
On the other hand, according to the conventional algorithm disclosed in JP 2005-167520A, for each pixel of a digitally compressed image, a variance of luminance values of a plurality of pixels within a block centered on that pixel and having a size of N×N is calculated. Subsequently, for each pixel of the digitally compressed image, the greatest value (more precisely, 0.01 times the greatest value) of a plurality of variances calculated for a plurality of pixels within a block centered on that pixel and having a size of M×M is derived as an ε value of the ε filter for that pixel. When the ε values have been derived, as in the case of the new algorithm, for each pixel of the digitally compressed image, an average value of one or more pixel values that are, among pixel values of a plurality of pixels within a block centered on that pixel and having a size of M×M, within a range of the pixel value of that pixel±ε is calculated and used as a corrected value of the pixel value of that pixel. The average value is calculated with respect to the luminance values. That is to say, the new algorithm and the conventional algorithm differ mainly in the method for calculating the ε values. It should be noted that in JP 2005-167520A, specific numerical values of N=7 and M=9 are given for the conventional algorithm.
In calculating the value for each pixel, the new algorithm is superior to the conventional algorithm in terms of the calculation speed. The reason for this is that according to the conventional algorithm, a variance is calculated for each pixel of a digitally compressed image, whereas according to the new algorithm, a standard deviation is calculated for each of blocks into which a digitally compressed image is divided without overlapping. However, when a standard deviation or the like is calculated for each of the blocks into which a digitally compressed image is divided without overlapping as in the case of the new algorithm, there is a possibility that the image quality of a corrected image after passing through the filter may be lower than that in the case of the conventional algorithm. The reason for this is that according to the conventional algorithm, the values for the respective pixels are calculated in units of blocks centered on the respective pixels, whereas according to the new algorithm, the values for the respective pixels are calculated in units of blocks that are not necessarily centered on the respective pixels, and thus a feature of the picture is not captured at its center.
However, there still is a problem with the conventional algorithm in terms of image quality. The reason for this is that according to the conventional algorithm, the variance is calculated only with respect to the luminance values, and with such a configuration, it is difficult to detect a contour line between objects that are the same in terms of the luminance but are different in terms of the saturation, hue, or the like, and therefore mosquito noise cannot be appropriately suppressed. It should be noted that according to the new algorithm, the standard deviation is calculated only with respect to the luminance values as well.